package com.nineclock.sign.controller;


import com.nineclock.common.entity.Result;
import com.nineclock.sign.SignControllerApi;
import com.nineclock.sign.service.SignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import com.nineclock.sign.SignInfoControllerApi;
import com.nineclock.sign.service.SignInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController
@RequestMapping
public class SignInfoController implements SignInfoControllerApi {

    @Autowired
    SignInfoService signInfoService;

    @Override
    @GetMapping("/export")
    public void exportSignData(@RequestParam String startTime, @RequestParam String endTime) throws IOException {
        signInfoService.exportSignData(startTime, endTime);
    }
    @Autowired
    SignService signService;
    @GetMapping("/getDayCount")
    public Result<Integer> getDayCount() {

        Integer dayCount = signService.getDayCount();
        return Result.success(dayCount);
    }

}
